<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
    <title>TODO supply a title</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div style="padding: 15px;">
    <form action="__CONTROLLER__/sub_order_info2" id="form2" method="post">
    <table class="table table-bordered">
        <input type="hidden" name="id" value="{$order['id']}">
        <tr>
            <td colspan="4">订单编号：{$order['orderid']}</td>
        </tr>
        <tr>
            <td>司机</td>
            <td>   
                <input type="text" name="openid" id="openid" placeholder="司机姓名或者手机号">
                 <div id="radiolist"></div>
                <!-- <span style="float:left;">{$siji}</span>

                <select name="openid" class="input-sm select-md col-sm-4" style="padding:0 5px;">
                    <option value="">选择司机</option>
                    <volist name="sj" id="vp">
                        <option value="{$vp.openid}">{$vp.xingming}</option>
                    </volist>
                </select> -->
            </td>
            <!--<td>支付状态</td>-->
            <!--<td>-->
                <!--<if condition="$vp['status'] lt 5">-->
                    <!--未支付-->
                    <!--<else/>-->
                    <!--<if condition="$vp['pay_status_sk'] eq 1">-->
                        <!--现金支付-->
                        <!--<else/>-->
                        <!--线上支付-->
                    <!--</if>-->
                <!--</if>-->
            <!--</td>-->
            <td>姓名</td>
            <td>{$xm['name']}</td>
        </tr>
        <tr>
                <td>乘客电话</td>
                <td><input type="text" name="tel" value="{$order['mobile']}"></td>
                <td>出发地</td>
                <td><input type="text" name="start" value="{$order['start']}"></td>
            </tr>
        <tr>

            <td>目的地</td>
            <td><input type="text" name="end" value="{$order['end']}"></td>
            <td>下单时间</td>
            <td><input type="text" value="{$order['addtime']|date='Y-m-d H:i:s',###}"></td>
        </tr>
        <tr>

            <td>出发时间</td>
            <td><input type="text" name="starttime" value="{$order['starttime']}"></td>
            <td>人数</td>
            <td>成人：<input type="text" name="num" value="{$order['num']}">人;</td>
        </tr>
        <tr>

            <td>金额</td>
            <td><input type="text" name="price" value="{$order['price']}"></td>
            <td>修改支付状态</td>
            <td>
                <select name="pay_statu" id="pay_statu">
                    <option value="0" <if condition="$order['pay_statu'] eq '0'">selected = "selected"</if>>未支付</option>
                    <option value="1" <if condition="$order['pay_statu'] eq '1'">selected = "selected"</if>>已支付</option>
                    <option value="999" <if condition="$order['pay_statu'] eq '999'">selected = "selected"</if>>已退款</option>
                </select>
                <!-- <if condition="$order['pay_statu'] eq '0'">未支付
                    <elseif condition="$order['pay_statu'] eq '1'"/>
                    已支付
                    <elseif condition="$order['pay_statu'] eq '999'"/>
                    <font color="red">已退款</font></if> -->
            </td>
        </tr>
        <tr>

            <td>订单类型</td>
            <td><input type="text" name="fs" value="{$order['fs']}"></td>
            <td>备注</td>
            <td><input type="text" name="crc" value="{$order['crc']}"></td>
        </tr>

        <if condition="$order['pay_statu'] neq '0'">
        <tr>
            <!-- <td>退款</td> -->
            <!-- <td colspan="3">请输入退款金额:<input type="text" id="tk_price" value=""><a onclick="tuikuan({$payinfo['id']})">退款</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已退款金额{$order['tk_price']}</td> -->

        </tr>
        </if>
      <a href="javascript:void(0)" id="sub_order" class="btn btn-primary" style="position:absolute;right: 50px;top: 10px;">确认修改</a>
    </table>
    </form>
</div>
<script>
        $("#sub_order").click(function(){
            $("#form2").submit();
        })

        function tuikuan(id) {
        if(confirm("退款操作不可逆？确认操作吗"))
        {
            var price=$('#tk_price').val();
            $.ajax({
                type: "POST",
                url: "__CONTROLLER__/tuikuan",

                cache: false,
                dataType: "json",
                async: false,
                data: {
                    id: id,
                    price:price
                },

                success: function (data) {
                    alert(data);
                    ////
                }


            });
        }else{
            return false;
        }
    }



    $("#openid").blur(function(){
       
        $("#radiolist").empty();
        var xingming    = $(this).val();
        $.post("{:U('Order/selectname')}",{name:xingming},function(data){
            datajson = $.parseJSON(data);
            if(datajson.code==0)
            {
                alert(datajson.msg);return false;
            }
            $.each(datajson.result,function(key,value){
                var html='<input type="radio" name="openid" value ="'+value['openid']+'">'+value['xingming']+':'+value['dianhua']+'<br>';
                $('#radiolist').append(html);
            })
        })
    });
</script>
</body>
</html>
